#! /bin/sh
# Create a 3D data set for Bill Wingle's block program--the
# name should end with ".su"
#
# This data set consists of one shot per line: the
# shotpoints move orthogonal to the receiver line
# with the scattering point below the midpoint of
# surface array.
#
# The data set consists of 32 receiver lines and 32 receivers per line 
# If your machine is fast enough, change nshot and nrec to 64 and change
# dsy and dgx to 50 to get a nicer data set that has 64 receiver lines
# and 64 receivers per line.

DIR=.
FILENAME=data3d  # shell appends the mandatory .su suffix


x0=0 y0=0 z0=1000
dt=0.004 nt=256

nshot=64 sx=0 dsy=50  symin=-1550
nrec=64  dgx=50 dgy=0 gxmin=-1550 gymin=-1550

>temp
jshot=0
while [ $jshot -lt $nshot ]
do
	sy=`bc -l <<-END
		$symin + $jshot * $dsy
	END`
	gy=$sy
	fldr=`bc -l <<-END
		$jshot + 1
	END`	

	suimp3d x0=$x0 y0=$y0 z0=$z0 \
		dt=$dt nt=$nt \
		sxmin=$sx symin=$sy \
		nrec=$nrec dgx=$dgx gxmin=$gxmin gymin=$gy |
		sushw key=fldr a=$fldr |
		sufilter | suaddnoise sn=10 >>temp

	jshot=`bc -l <<-END
		$jshot + 1
	END`
done

# since combining many suimp3d outputs, reset the trace numbering
sushw <temp key=tracl,tracr a=1,1 b=1,1 >$DIR/$FILENAME.su

rm temp

exit 0
